Left Termination of the query pattern rem_in_3(g, a, g) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

rem(X, Y, R) :- ','(notZero(Y), ','(sub(X, Y, Z), rem(Z, Y, R))).
rem(X, Y, X) :- ','(notZero(Y), geq(X, Y)).
sub(s(X), s(Y), Z) :- sub(X, Y, Z).
sub(X, 0, X).
notZero(s(X)).
geq(s(X), s(Y)) :- geq(X, Y).
geq(X, 0).

Queries:

rem(g,a,g).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x2)
U7(x1, x2, x3)  =  U7(x3)
rem_out(x1, x2, x3)  =  rem_out(x2)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x2, x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U3(x1, x2, x3, x4)  =  U3(x2, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x2)
U7(x1, x2, x3)  =  U7(x3)
rem_out(x1, x2, x3)  =  rem_out(x2)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x2, x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U3(x1, x2, x3, x4)  =  U3(x2, x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

REM_IN(X, Y, X) → U41(X, Y, notZero_in(Y))
REM_IN(X, Y, X) → NOTZERO_IN(Y)
U41(X, Y, notZero_out(Y)) → U51(X, Y, geq_in(X, Y))
U41(X, Y, notZero_out(Y)) → GEQ_IN(X, Y)
GEQ_IN(s(X), s(Y)) → U71(X, Y, geq_in(X, Y))
GEQ_IN(s(X), s(Y)) → GEQ_IN(X, Y)
REM_IN(X, Y, R) → U11(X, Y, R, notZero_in(Y))
REM_IN(X, Y, R) → NOTZERO_IN(Y)
U11(X, Y, R, notZero_out(Y)) → U21(X, Y, R, sub_in(X, Y, Z))
U11(X, Y, R, notZero_out(Y)) → SUB_IN(X, Y, Z)
SUB_IN(s(X), s(Y), Z) → U61(X, Y, Z, sub_in(X, Y, Z))
SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)
U21(X, Y, R, sub_out(X, Y, Z)) → U31(X, Y, R, rem_in(Z, Y, R))
U21(X, Y, R, sub_out(X, Y, Z)) → REM_IN(Z, Y, R)

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x2)
U7(x1, x2, x3)  =  U7(x3)
rem_out(x1, x2, x3)  =  rem_out(x2)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x2, x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
U71(x1, x2, x3)  =  U71(x3)
U51(x1, x2, x3)  =  U51(x3)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
U41(x1, x2, x3)  =  U41(x1, x3)
REM_IN(x1, x2, x3)  =  REM_IN(x1, x3)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1)
GEQ_IN(x1, x2)  =  GEQ_IN(x1)
U21(x1, x2, x3, x4)  =  U21(x3, x4)
U61(x1, x2, x3, x4)  =  U61(x4)
NOTZERO_IN(x1)  =  NOTZERO_IN
U11(x1, x2, x3, x4)  =  U11(x1, x3, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

REM_IN(X, Y, X) → U41(X, Y, notZero_in(Y))
REM_IN(X, Y, X) → NOTZERO_IN(Y)
U41(X, Y, notZero_out(Y)) → U51(X, Y, geq_in(X, Y))
U41(X, Y, notZero_out(Y)) → GEQ_IN(X, Y)
GEQ_IN(s(X), s(Y)) → U71(X, Y, geq_in(X, Y))
GEQ_IN(s(X), s(Y)) → GEQ_IN(X, Y)
REM_IN(X, Y, R) → U11(X, Y, R, notZero_in(Y))
REM_IN(X, Y, R) → NOTZERO_IN(Y)
U11(X, Y, R, notZero_out(Y)) → U21(X, Y, R, sub_in(X, Y, Z))
U11(X, Y, R, notZero_out(Y)) → SUB_IN(X, Y, Z)
SUB_IN(s(X), s(Y), Z) → U61(X, Y, Z, sub_in(X, Y, Z))
SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)
U21(X, Y, R, sub_out(X, Y, Z)) → U31(X, Y, R, rem_in(Z, Y, R))
U21(X, Y, R, sub_out(X, Y, Z)) → REM_IN(Z, Y, R)

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x2)
U7(x1, x2, x3)  =  U7(x3)
rem_out(x1, x2, x3)  =  rem_out(x2)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x2, x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
U71(x1, x2, x3)  =  U71(x3)
U51(x1, x2, x3)  =  U51(x3)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
U41(x1, x2, x3)  =  U41(x1, x3)
REM_IN(x1, x2, x3)  =  REM_IN(x1, x3)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1)
GEQ_IN(x1, x2)  =  GEQ_IN(x1)
U21(x1, x2, x3, x4)  =  U21(x3, x4)
U61(x1, x2, x3, x4)  =  U61(x4)
NOTZERO_IN(x1)  =  NOTZERO_IN
U11(x1, x2, x3, x4)  =  U11(x1, x3, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 9 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x2)
U7(x1, x2, x3)  =  U7(x3)
rem_out(x1, x2, x3)  =  rem_out(x2)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x2, x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

SUB_IN(s(X)) → SUB_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

GEQ_IN(s(X), s(Y)) → GEQ_IN(X, Y)

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x2)
U7(x1, x2, x3)  =  U7(x3)
rem_out(x1, x2, x3)  =  rem_out(x2)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x2, x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
GEQ_IN(x1, x2)  =  GEQ_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

GEQ_IN(s(X), s(Y)) → GEQ_IN(X, Y)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
GEQ_IN(x1, x2)  =  GEQ_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

GEQ_IN(s(X)) → GEQ_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U21(X, Y, R, sub_out(X, Y, Z)) → REM_IN(Z, Y, R)
REM_IN(X, Y, R) → U11(X, Y, R, notZero_in(Y))
U11(X, Y, R, notZero_out(Y)) → U21(X, Y, R, sub_in(X, Y, Z))

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x2)
U7(x1, x2, x3)  =  U7(x3)
rem_out(x1, x2, x3)  =  rem_out(x2)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x2, x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
REM_IN(x1, x2, x3)  =  REM_IN(x1, x3)
U21(x1, x2, x3, x4)  =  U21(x3, x4)
U11(x1, x2, x3, x4)  =  U11(x1, x3, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U21(X, Y, R, sub_out(X, Y, Z)) → REM_IN(Z, Y, R)
REM_IN(X, Y, R) → U11(X, Y, R, notZero_in(Y))
U11(X, Y, R, notZero_out(Y)) → U21(X, Y, R, sub_in(X, Y, Z))

The TRS R consists of the following rules:

notZero_in(s(X)) → notZero_out(s(X))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The argument filtering Pi contains the following mapping:
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
0  =  0
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x2, x3)
U6(x1, x2, x3, x4)  =  U6(x4)
REM_IN(x1, x2, x3)  =  REM_IN(x1, x3)
U21(x1, x2, x3, x4)  =  U21(x3, x4)
U11(x1, x2, x3, x4)  =  U11(x1, x3, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ RuleRemovalProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_in(X))
REM_IN(X, R) → U11(X, R, notZero_in)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

The TRS R consists of the following rules:

notZero_innotZero_out
sub_in(X) → sub_out(0, X)
sub_in(s(X)) → U6(sub_in(X))
U6(sub_out(Y, Z)) → sub_out(s(Y), Z)

The set Q consists of the following terms:

notZero_in
sub_in(x0)
U6(x0)

We have to consider all (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

U6(sub_out(Y, Z)) → sub_out(s(Y), Z)

Used ordering: POLO with Polynomial interpretation [25]:

POL(0) = 0   
POL(REM_IN(x1, x2)) = 2·x1 + x2   
POL(U11(x1, x2, x3)) = 2·x1 + x2 + 2·x3   
POL(U21(x1, x2)) = x1 + x2   
POL(U6(x1)) = 2 + 2·x1   
POL(notZero_in) = 0   
POL(notZero_out) = 0   
POL(s(x1)) = 1 + 2·x1   
POL(sub_in(x1)) = 2·x1   
POL(sub_out(x1, x2)) = x1 + 2·x2   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
QDP
                            ↳ UsableRulesReductionPairsProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_in(X))
REM_IN(X, R) → U11(X, R, notZero_in)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

The TRS R consists of the following rules:

notZero_innotZero_out
sub_in(X) → sub_out(0, X)
sub_in(s(X)) → U6(sub_in(X))

The set Q consists of the following terms:

notZero_in
sub_in(x0)
U6(x0)

We have to consider all (P,Q,R)-chains.
By using the usable rules with reduction pair processor [15] with a polynomial ordering [25], all dependency pairs and the corresponding usable rules [17] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

No dependency pairs are removed.

The following rules are removed from R:

sub_in(s(X)) → U6(sub_in(X))
Used ordering: POLO with Polynomial interpretation [25]:

POL(0) = 0   
POL(REM_IN(x1, x2)) = 1 + x1 + x2   
POL(U11(x1, x2, x3)) = x1 + x2 + x3   
POL(U21(x1, x2)) = 1 + x1 + x2   
POL(U6(x1)) = 2·x1   
POL(notZero_in) = 1   
POL(notZero_out) = 1   
POL(s(x1)) = 2·x1   
POL(sub_in(x1)) = x1   
POL(sub_out(x1, x2)) = 2·x1 + x2   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
                          ↳ QDP
                            ↳ UsableRulesReductionPairsProof
QDP
                                ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_in(X))
REM_IN(X, R) → U11(X, R, notZero_in)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

The TRS R consists of the following rules:

notZero_innotZero_out
sub_in(X) → sub_out(0, X)

The set Q consists of the following terms:

notZero_in
sub_in(x0)
U6(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

U6(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
                          ↳ QDP
                            ↳ UsableRulesReductionPairsProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ Rewriting
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_in(X))
REM_IN(X, R) → U11(X, R, notZero_in)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

The TRS R consists of the following rules:

notZero_innotZero_out
sub_in(X) → sub_out(0, X)

The set Q consists of the following terms:

notZero_in
sub_in(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule U11(X, R, notZero_out) → U21(R, sub_in(X)) at position [1] we obtained the following new rules:

U11(X, R, notZero_out) → U21(R, sub_out(0, X))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
                          ↳ QDP
                            ↳ UsableRulesReductionPairsProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Rewriting
QDP
                                        ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_out(0, X))
REM_IN(X, R) → U11(X, R, notZero_in)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

The TRS R consists of the following rules:

notZero_innotZero_out
sub_in(X) → sub_out(0, X)

The set Q consists of the following terms:

notZero_in
sub_in(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
                          ↳ QDP
                            ↳ UsableRulesReductionPairsProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Rewriting
                                      ↳ QDP
                                        ↳ UsableRulesProof
QDP
                                            ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_out(0, X))
REM_IN(X, R) → U11(X, R, notZero_in)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

The TRS R consists of the following rules:

notZero_innotZero_out

The set Q consists of the following terms:

notZero_in
sub_in(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

sub_in(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
                          ↳ QDP
                            ↳ UsableRulesReductionPairsProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Rewriting
                                      ↳ QDP
                                        ↳ UsableRulesProof
                                          ↳ QDP
                                            ↳ QReductionProof
QDP
                                                ↳ Rewriting
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_out(0, X))
REM_IN(X, R) → U11(X, R, notZero_in)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

The TRS R consists of the following rules:

notZero_innotZero_out

The set Q consists of the following terms:

notZero_in

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule REM_IN(X, R) → U11(X, R, notZero_in) at position [2] we obtained the following new rules:

REM_IN(X, R) → U11(X, R, notZero_out)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
                          ↳ QDP
                            ↳ UsableRulesReductionPairsProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Rewriting
                                      ↳ QDP
                                        ↳ UsableRulesProof
                                          ↳ QDP
                                            ↳ QReductionProof
                                              ↳ QDP
                                                ↳ Rewriting
QDP
                                                    ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_out(0, X))
REM_IN(X, R) → U11(X, R, notZero_out)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

The TRS R consists of the following rules:

notZero_innotZero_out

The set Q consists of the following terms:

notZero_in

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
                          ↳ QDP
                            ↳ UsableRulesReductionPairsProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Rewriting
                                      ↳ QDP
                                        ↳ UsableRulesProof
                                          ↳ QDP
                                            ↳ QReductionProof
                                              ↳ QDP
                                                ↳ Rewriting
                                                  ↳ QDP
                                                    ↳ UsableRulesProof
QDP
                                                        ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_out(0, X))
REM_IN(X, R) → U11(X, R, notZero_out)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

R is empty.
The set Q consists of the following terms:

notZero_in

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

notZero_in



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
                          ↳ QDP
                            ↳ UsableRulesReductionPairsProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Rewriting
                                      ↳ QDP
                                        ↳ UsableRulesProof
                                          ↳ QDP
                                            ↳ QReductionProof
                                              ↳ QDP
                                                ↳ Rewriting
                                                  ↳ QDP
                                                    ↳ UsableRulesProof
                                                      ↳ QDP
                                                        ↳ QReductionProof
QDP
                                                            ↳ Instantiation
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_out(0, X))
REM_IN(X, R) → U11(X, R, notZero_out)
U21(R, sub_out(Y, Z)) → REM_IN(Z, R)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U21(R, sub_out(Y, Z)) → REM_IN(Z, R) we obtained the following new rules:

U21(z1, sub_out(0, z0)) → REM_IN(z0, z1)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
                          ↳ QDP
                            ↳ UsableRulesReductionPairsProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Rewriting
                                      ↳ QDP
                                        ↳ UsableRulesProof
                                          ↳ QDP
                                            ↳ QReductionProof
                                              ↳ QDP
                                                ↳ Rewriting
                                                  ↳ QDP
                                                    ↳ UsableRulesProof
                                                      ↳ QDP
                                                        ↳ QReductionProof
                                                          ↳ QDP
                                                            ↳ Instantiation
QDP
                                                                ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_out(0, X))
REM_IN(X, R) → U11(X, R, notZero_out)
U21(z1, sub_out(0, z0)) → REM_IN(z0, z1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

U11(X, R, notZero_out) → U21(R, sub_out(0, X))
REM_IN(X, R) → U11(X, R, notZero_out)
U21(z1, sub_out(0, z0)) → REM_IN(z0, z1)

The TRS R consists of the following rules:none


s = U21(z1, sub_out(0, z0)) evaluates to t =U21(z1, sub_out(0, z0))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

U21(z1, sub_out(0, z0))REM_IN(z0, z1)
with rule U21(z1', sub_out(0, z0')) → REM_IN(z0', z1') at position [] and matcher [z1' / z1, z0' / z0]

REM_IN(z0, z1)U11(z0, z1, notZero_out)
with rule REM_IN(X', R') → U11(X', R', notZero_out) at position [] and matcher [R' / z1, X' / z0]

U11(z0, z1, notZero_out)U21(z1, sub_out(0, z0))
with rule U11(X, R, notZero_out) → U21(R, sub_out(0, X))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.




We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x1, x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x1, x2)
U7(x1, x2, x3)  =  U7(x1, x3)
rem_out(x1, x2, x3)  =  rem_out(x1, x2, x3)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x1, x2, x3)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x3, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x1, x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x1, x2)
U7(x1, x2, x3)  =  U7(x1, x3)
rem_out(x1, x2, x3)  =  rem_out(x1, x2, x3)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x1, x2, x3)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x3, x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

REM_IN(X, Y, X) → U41(X, Y, notZero_in(Y))
REM_IN(X, Y, X) → NOTZERO_IN(Y)
U41(X, Y, notZero_out(Y)) → U51(X, Y, geq_in(X, Y))
U41(X, Y, notZero_out(Y)) → GEQ_IN(X, Y)
GEQ_IN(s(X), s(Y)) → U71(X, Y, geq_in(X, Y))
GEQ_IN(s(X), s(Y)) → GEQ_IN(X, Y)
REM_IN(X, Y, R) → U11(X, Y, R, notZero_in(Y))
REM_IN(X, Y, R) → NOTZERO_IN(Y)
U11(X, Y, R, notZero_out(Y)) → U21(X, Y, R, sub_in(X, Y, Z))
U11(X, Y, R, notZero_out(Y)) → SUB_IN(X, Y, Z)
SUB_IN(s(X), s(Y), Z) → U61(X, Y, Z, sub_in(X, Y, Z))
SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)
U21(X, Y, R, sub_out(X, Y, Z)) → U31(X, Y, R, rem_in(Z, Y, R))
U21(X, Y, R, sub_out(X, Y, Z)) → REM_IN(Z, Y, R)

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x1, x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x1, x2)
U7(x1, x2, x3)  =  U7(x1, x3)
rem_out(x1, x2, x3)  =  rem_out(x1, x2, x3)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x1, x2, x3)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x3, x4)
U71(x1, x2, x3)  =  U71(x1, x3)
U51(x1, x2, x3)  =  U51(x1, x3)
U31(x1, x2, x3, x4)  =  U31(x1, x2, x3, x4)
U41(x1, x2, x3)  =  U41(x1, x3)
REM_IN(x1, x2, x3)  =  REM_IN(x1, x3)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1)
GEQ_IN(x1, x2)  =  GEQ_IN(x1)
U21(x1, x2, x3, x4)  =  U21(x1, x3, x4)
U61(x1, x2, x3, x4)  =  U61(x1, x4)
NOTZERO_IN(x1)  =  NOTZERO_IN
U11(x1, x2, x3, x4)  =  U11(x1, x3, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

REM_IN(X, Y, X) → U41(X, Y, notZero_in(Y))
REM_IN(X, Y, X) → NOTZERO_IN(Y)
U41(X, Y, notZero_out(Y)) → U51(X, Y, geq_in(X, Y))
U41(X, Y, notZero_out(Y)) → GEQ_IN(X, Y)
GEQ_IN(s(X), s(Y)) → U71(X, Y, geq_in(X, Y))
GEQ_IN(s(X), s(Y)) → GEQ_IN(X, Y)
REM_IN(X, Y, R) → U11(X, Y, R, notZero_in(Y))
REM_IN(X, Y, R) → NOTZERO_IN(Y)
U11(X, Y, R, notZero_out(Y)) → U21(X, Y, R, sub_in(X, Y, Z))
U11(X, Y, R, notZero_out(Y)) → SUB_IN(X, Y, Z)
SUB_IN(s(X), s(Y), Z) → U61(X, Y, Z, sub_in(X, Y, Z))
SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)
U21(X, Y, R, sub_out(X, Y, Z)) → U31(X, Y, R, rem_in(Z, Y, R))
U21(X, Y, R, sub_out(X, Y, Z)) → REM_IN(Z, Y, R)

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x1, x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x1, x2)
U7(x1, x2, x3)  =  U7(x1, x3)
rem_out(x1, x2, x3)  =  rem_out(x1, x2, x3)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x1, x2, x3)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x3, x4)
U71(x1, x2, x3)  =  U71(x1, x3)
U51(x1, x2, x3)  =  U51(x1, x3)
U31(x1, x2, x3, x4)  =  U31(x1, x2, x3, x4)
U41(x1, x2, x3)  =  U41(x1, x3)
REM_IN(x1, x2, x3)  =  REM_IN(x1, x3)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1)
GEQ_IN(x1, x2)  =  GEQ_IN(x1)
U21(x1, x2, x3, x4)  =  U21(x1, x3, x4)
U61(x1, x2, x3, x4)  =  U61(x1, x4)
NOTZERO_IN(x1)  =  NOTZERO_IN
U11(x1, x2, x3, x4)  =  U11(x1, x3, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 9 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x1, x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x1, x2)
U7(x1, x2, x3)  =  U7(x1, x3)
rem_out(x1, x2, x3)  =  rem_out(x1, x2, x3)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x1, x2, x3)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x3, x4)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SUB_IN(s(X)) → SUB_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GEQ_IN(s(X), s(Y)) → GEQ_IN(X, Y)

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x1, x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x1, x2)
U7(x1, x2, x3)  =  U7(x1, x3)
rem_out(x1, x2, x3)  =  rem_out(x1, x2, x3)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x1, x2, x3)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x3, x4)
GEQ_IN(x1, x2)  =  GEQ_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GEQ_IN(s(X), s(Y)) → GEQ_IN(X, Y)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
GEQ_IN(x1, x2)  =  GEQ_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

GEQ_IN(s(X)) → GEQ_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

U21(X, Y, R, sub_out(X, Y, Z)) → REM_IN(Z, Y, R)
REM_IN(X, Y, R) → U11(X, Y, R, notZero_in(Y))
U11(X, Y, R, notZero_out(Y)) → U21(X, Y, R, sub_in(X, Y, Z))

The TRS R consists of the following rules:

rem_in(X, Y, X) → U4(X, Y, notZero_in(Y))
notZero_in(s(X)) → notZero_out(s(X))
U4(X, Y, notZero_out(Y)) → U5(X, Y, geq_in(X, Y))
geq_in(X, 0) → geq_out(X, 0)
geq_in(s(X), s(Y)) → U7(X, Y, geq_in(X, Y))
U7(X, Y, geq_out(X, Y)) → geq_out(s(X), s(Y))
U5(X, Y, geq_out(X, Y)) → rem_out(X, Y, X)
rem_in(X, Y, R) → U1(X, Y, R, notZero_in(Y))
U1(X, Y, R, notZero_out(Y)) → U2(X, Y, R, sub_in(X, Y, Z))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U2(X, Y, R, sub_out(X, Y, Z)) → U3(X, Y, R, rem_in(Z, Y, R))
U3(X, Y, R, rem_out(Z, Y, R)) → rem_out(X, Y, R)

The argument filtering Pi contains the following mapping:
rem_in(x1, x2, x3)  =  rem_in(x1, x3)
U4(x1, x2, x3)  =  U4(x1, x3)
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
U5(x1, x2, x3)  =  U5(x1, x3)
geq_in(x1, x2)  =  geq_in(x1)
0  =  0
geq_out(x1, x2)  =  geq_out(x1, x2)
U7(x1, x2, x3)  =  U7(x1, x3)
rem_out(x1, x2, x3)  =  rem_out(x1, x2, x3)
U1(x1, x2, x3, x4)  =  U1(x1, x3, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x3, x4)
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x1, x2, x3)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x3, x4)
REM_IN(x1, x2, x3)  =  REM_IN(x1, x3)
U21(x1, x2, x3, x4)  =  U21(x1, x3, x4)
U11(x1, x2, x3, x4)  =  U11(x1, x3, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U21(X, Y, R, sub_out(X, Y, Z)) → REM_IN(Z, Y, R)
REM_IN(X, Y, R) → U11(X, Y, R, notZero_in(Y))
U11(X, Y, R, notZero_out(Y)) → U21(X, Y, R, sub_in(X, Y, Z))

The TRS R consists of the following rules:

notZero_in(s(X)) → notZero_out(s(X))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The argument filtering Pi contains the following mapping:
notZero_in(x1)  =  notZero_in
s(x1)  =  s(x1)
notZero_out(x1)  =  notZero_out
0  =  0
sub_in(x1, x2, x3)  =  sub_in(x1)
sub_out(x1, x2, x3)  =  sub_out(x1, x2, x3)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
REM_IN(x1, x2, x3)  =  REM_IN(x1, x3)
U21(x1, x2, x3, x4)  =  U21(x1, x3, x4)
U11(x1, x2, x3, x4)  =  U11(x1, x3, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Rewriting

Q DP problem:
The TRS P consists of the following rules:

REM_IN(X, R) → U11(X, R, notZero_in)
U21(X, R, sub_out(X, Y, Z)) → REM_IN(Z, R)
U11(X, R, notZero_out) → U21(X, R, sub_in(X))

The TRS R consists of the following rules:

notZero_innotZero_out
sub_in(X) → sub_out(X, 0, X)
sub_in(s(X)) → U6(X, sub_in(X))
U6(X, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The set Q consists of the following terms:

notZero_in
sub_in(x0)
U6(x0, x1)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule REM_IN(X, R) → U11(X, R, notZero_in) at position [2] we obtained the following new rules:

REM_IN(X, R) → U11(X, R, notZero_out)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
QDP
                            ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

REM_IN(X, R) → U11(X, R, notZero_out)
U21(X, R, sub_out(X, Y, Z)) → REM_IN(Z, R)
U11(X, R, notZero_out) → U21(X, R, sub_in(X))

The TRS R consists of the following rules:

notZero_innotZero_out
sub_in(X) → sub_out(X, 0, X)
sub_in(s(X)) → U6(X, sub_in(X))
U6(X, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The set Q consists of the following terms:

notZero_in
sub_in(x0)
U6(x0, x1)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

REM_IN(X, R) → U11(X, R, notZero_out)
U21(X, R, sub_out(X, Y, Z)) → REM_IN(Z, R)
U11(X, R, notZero_out) → U21(X, R, sub_in(X))

The TRS R consists of the following rules:

sub_in(X) → sub_out(X, 0, X)
sub_in(s(X)) → U6(X, sub_in(X))
U6(X, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The set Q consists of the following terms:

notZero_in
sub_in(x0)
U6(x0, x1)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

notZero_in



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

REM_IN(X, R) → U11(X, R, notZero_out)
U21(X, R, sub_out(X, Y, Z)) → REM_IN(Z, R)
U11(X, R, notZero_out) → U21(X, R, sub_in(X))

The TRS R consists of the following rules:

sub_in(X) → sub_out(X, 0, X)
sub_in(s(X)) → U6(X, sub_in(X))
U6(X, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The set Q consists of the following terms:

sub_in(x0)
U6(x0, x1)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule U11(X, R, notZero_out) → U21(X, R, sub_in(X)) at position [2] we obtained the following new rules:

U11(s(x0), y1, notZero_out) → U21(s(x0), y1, U6(x0, sub_in(x0)))
U11(x0, y1, notZero_out) → U21(x0, y1, sub_out(x0, 0, x0))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
QDP
                                        ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

U11(x0, y1, notZero_out) → U21(x0, y1, sub_out(x0, 0, x0))
REM_IN(X, R) → U11(X, R, notZero_out)
U21(X, R, sub_out(X, Y, Z)) → REM_IN(Z, R)
U11(s(x0), y1, notZero_out) → U21(s(x0), y1, U6(x0, sub_in(x0)))

The TRS R consists of the following rules:

sub_in(X) → sub_out(X, 0, X)
sub_in(s(X)) → U6(X, sub_in(X))
U6(X, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The set Q consists of the following terms:

sub_in(x0)
U6(x0, x1)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U21(X, R, sub_out(X, Y, Z)) → REM_IN(Z, R) we obtained the following new rules:

U21(s(z0), z1, sub_out(s(z0), x2, x3)) → REM_IN(x3, z1)
U21(z0, z1, sub_out(z0, 0, z0)) → REM_IN(z0, z1)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ Instantiation
QDP
                                            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U11(x0, y1, notZero_out) → U21(x0, y1, sub_out(x0, 0, x0))
U21(s(z0), z1, sub_out(s(z0), x2, x3)) → REM_IN(x3, z1)
U21(z0, z1, sub_out(z0, 0, z0)) → REM_IN(z0, z1)
REM_IN(X, R) → U11(X, R, notZero_out)
U11(s(x0), y1, notZero_out) → U21(s(x0), y1, U6(x0, sub_in(x0)))

The TRS R consists of the following rules:

sub_in(X) → sub_out(X, 0, X)
sub_in(s(X)) → U6(X, sub_in(X))
U6(X, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The set Q consists of the following terms:

sub_in(x0)
U6(x0, x1)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U11(s(x0), y1, notZero_out) → U21(s(x0), y1, U6(x0, sub_in(x0)))
The remaining pairs can at least be oriented weakly.

U11(x0, y1, notZero_out) → U21(x0, y1, sub_out(x0, 0, x0))
U21(s(z0), z1, sub_out(s(z0), x2, x3)) → REM_IN(x3, z1)
U21(z0, z1, sub_out(z0, 0, z0)) → REM_IN(z0, z1)
REM_IN(X, R) → U11(X, R, notZero_out)
Used ordering: Combined order from the following AFS and order.
U11(x1, x2, x3)  =  U11(x1, x2)
notZero_out  =  notZero_out
U21(x1, x2, x3)  =  U21(x2, x3)
sub_out(x1, x2, x3)  =  x3
0  =  0
s(x1)  =  s(x1)
REM_IN(x1, x2)  =  REM_IN(x1, x2)
U6(x1, x2)  =  U6(x1, x2)
sub_in(x1)  =  sub_in(x1)

Recursive path order with status [2].
Quasi-Precedence:
0 > [U1^12, U2^12, REMIN2] > notZeroout > subin1
0 > [U1^12, U2^12, REMIN2] > s1 > U62 > subin1

Status:
U62: [1,2]
U1^12: multiset
s1: multiset
0: multiset
U2^12: multiset
subin1: multiset
REMIN2: multiset
notZeroout: multiset


The following usable rules [17] were oriented:

sub_in(s(X)) → U6(X, sub_in(X))
sub_in(X) → sub_out(X, 0, X)
U6(X, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ Instantiation
                                          ↳ QDP
                                            ↳ QDPOrderProof
QDP
                                                ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

U11(x0, y1, notZero_out) → U21(x0, y1, sub_out(x0, 0, x0))
U21(s(z0), z1, sub_out(s(z0), x2, x3)) → REM_IN(x3, z1)
REM_IN(X, R) → U11(X, R, notZero_out)
U21(z0, z1, sub_out(z0, 0, z0)) → REM_IN(z0, z1)

The TRS R consists of the following rules:

sub_in(X) → sub_out(X, 0, X)
sub_in(s(X)) → U6(X, sub_in(X))
U6(X, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The set Q consists of the following terms:

sub_in(x0)
U6(x0, x1)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ Instantiation
                                          ↳ QDP
                                            ↳ QDPOrderProof
                                              ↳ QDP
                                                ↳ UsableRulesProof
QDP
                                                    ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

U11(x0, y1, notZero_out) → U21(x0, y1, sub_out(x0, 0, x0))
U21(s(z0), z1, sub_out(s(z0), x2, x3)) → REM_IN(x3, z1)
REM_IN(X, R) → U11(X, R, notZero_out)
U21(z0, z1, sub_out(z0, 0, z0)) → REM_IN(z0, z1)

R is empty.
The set Q consists of the following terms:

sub_in(x0)
U6(x0, x1)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

sub_in(x0)
U6(x0, x1)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ Instantiation
                                          ↳ QDP
                                            ↳ QDPOrderProof
                                              ↳ QDP
                                                ↳ UsableRulesProof
                                                  ↳ QDP
                                                    ↳ QReductionProof
QDP
                                                        ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

U11(x0, y1, notZero_out) → U21(x0, y1, sub_out(x0, 0, x0))
U21(s(z0), z1, sub_out(s(z0), x2, x3)) → REM_IN(x3, z1)
U21(z0, z1, sub_out(z0, 0, z0)) → REM_IN(z0, z1)
REM_IN(X, R) → U11(X, R, notZero_out)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U21(s(z0), z1, sub_out(s(z0), x2, x3)) → REM_IN(x3, z1) we obtained the following new rules:

U21(s(x0), z1, sub_out(s(x0), 0, s(x0))) → REM_IN(s(x0), z1)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ Instantiation
                                          ↳ QDP
                                            ↳ QDPOrderProof
                                              ↳ QDP
                                                ↳ UsableRulesProof
                                                  ↳ QDP
                                                    ↳ QReductionProof
                                                      ↳ QDP
                                                        ↳ Instantiation
QDP
                                                            ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

U21(s(x0), z1, sub_out(s(x0), 0, s(x0))) → REM_IN(s(x0), z1)
U11(x0, y1, notZero_out) → U21(x0, y1, sub_out(x0, 0, x0))
REM_IN(X, R) → U11(X, R, notZero_out)
U21(z0, z1, sub_out(z0, 0, z0)) → REM_IN(z0, z1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

U21(s(x0), z1, sub_out(s(x0), 0, s(x0))) → REM_IN(s(x0), z1)
U11(x0, y1, notZero_out) → U21(x0, y1, sub_out(x0, 0, x0))
REM_IN(X, R) → U11(X, R, notZero_out)
U21(z0, z1, sub_out(z0, 0, z0)) → REM_IN(z0, z1)

The TRS R consists of the following rules:none


s = REM_IN(s(x0), R) evaluates to t =REM_IN(s(x0), R)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

REM_IN(s(x0), R)U11(s(x0), R, notZero_out)
with rule REM_IN(X, R') → U11(X, R', notZero_out) at position [] and matcher [X / s(x0), R' / R]

U11(s(x0), R, notZero_out)U21(s(x0), R, sub_out(s(x0), 0, s(x0)))
with rule U11(x0', y1, notZero_out) → U21(x0', y1, sub_out(x0', 0, x0')) at position [] and matcher [y1 / R, x0' / s(x0)]

U21(s(x0), R, sub_out(s(x0), 0, s(x0)))REM_IN(s(x0), R)
with rule U21(s(x0), z1, sub_out(s(x0), 0, s(x0))) → REM_IN(s(x0), z1)

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.